/*==============================================================================
            Copyright (c) 2013 Moritz Hader, Marcel Schrder
            All Rights Reserved.

	@file  HeimdallGLUtilities.h

	@brief Header for HeimdallGLUtilities.cpp
   
   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

==============================================================================*/

#ifndef _HEIMDALLGLUTILITIES_LIBRARY__
#define _HEIMDALLGLUTILITIES_LIBRARY__

#include <GLES2/gl2.h>
#include <android/log.h>

#include <jni.h>

#include <egl/HeimdallMath.h>

//Forward declarations
class VertexManagementUnit;

#ifndef LOG_TAG
	#define LOG_TAG "HeimdallAR" // text for log tag
#endif


//Some basic utilities we use to for Open GL Error-Checking
bool CheckShadersForError(GLuint handle);
bool CheckProgrammForError(GLuint handle);
void CheckGlError(const char* operation);


//Generation of basic shapes
void GenSimpleCube(VertexManagementUnit** vertMU, float width);
void GenSimpleGrid(VertexManagementUnit** vertMU, float width, float step);
void GenSimpleCone(VertexManagementUnit** vertMU);
void GenSimpleBarrier(VertexManagementUnit** vertMU);
void GenSimpleTrafficL(VertexManagementUnit** vertMU);
void GenSimpleFancyCar(VertexManagementUnit** vertMU);


//Jni Conversion etc.
void loadFloat3DArray(JNIEnv* env, jobject nativeObj, jclass hdClass, const char* method, H3DVector* output);
void loadFloat4DArray(JNIEnv* env, jobject nativeObj, jclass hdClass, const char* method, H4DVector* output);
//void pushIdentifierToJava(JNIEnv *env, jobject obj, int id);
int getCorrespondingMarker(JNIEnv *env, jobject obj, jclass hdClass);

#endif
